package com.nxk.modules.core.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;

@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Data
@TableName("sys_menu")
public class SysMenu extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.UUID)
    private String id;

    @NotEmpty(message = "菜单名称不能为空")
    @Length(max = 64,message = "菜单名称不能大于64位")
    private String menuName;

    //@NotEmpty(message = "菜单链接不能为空")
    @Length(max = 255,message = "菜单链接不能大于255位")
    private String menuLink;

    @Length(max = 64,message = "菜单图标不能大于64位")
    private String menuIcon;

    @NotEmpty(message = "请选择菜单或权限")
    @Length(max = 1,message = "菜单权限不能大于1位")
    private String menuRole;

    @Length(max = 255,message = "权限标识不能大于255位")
    private String menuIdent;

    @Length(max = 64,message = "父级菜单不能大于64位")
    private String parentId;

    @Length(max = 64,message = "父菜单名称不能大于64位")
    private String parentName;  //存放父菜单名称

    @TableField(exist = false)
    private List<SysMenu> children;  //存放子菜单

    public final static String MENU = "1";

    public final static String ROLE = "2";
























}
